package cn.com.taiji.oospub.wechat.common.wxpay.util;


import cn.com.taiji.oospub.wechat.mapper.MemberBaseInfoMapper;
import org.springframework.web.context.WebApplicationContext;
import org.springframework.web.context.support.WebApplicationContextUtils;

import javax.servlet.http.HttpServlet;
import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;


public class CommonProperties extends HttpServlet {
	public static  String PROPASS;
	public static  String PROJECT_CODE;
	public static  String CUS_NAME;
	

	@Override
	public void init(){
		Properties props = new Properties();
		WebApplicationContext upAndDownText = WebApplicationContextUtils
				.getRequiredWebApplicationContext(getServletContext()); // 获取Spring上下文
		MemberBaseInfoMapper memberBaseInfoManager = (MemberBaseInfoMapper) upAndDownText.getBean("memberBaseInfoManager", MemberBaseInfoMapper.class);
		try {
			InputStream kongxc_sysPosMachine_Stream = upAndDownText.getResource("/WEB-INF/conf/common.properties").getInputStream();
			props.load(kongxc_sysPosMachine_Stream);
			PROPASS = props.getProperty("PROPASS");
			PROJECT_CODE = props.getProperty("PROJECT_CODE");
			CUS_NAME = props.getProperty("CUS_NAME");
		
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
		
		
		
		
	}
	
	
	
	
	
}
